#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>



  struct ListNode 
  {
      int val;
     struct ListNode *next;
  };
 
typedef struct ListNode LNode;
struct ListNode* middleNode(struct ListNode* head) {
    LNode* fast = head;
    LNode* slow = head;
    while (fast && fast->next)
    {
        fast = fast->next->next;
        slow = slow->next;
    }
    return slow;
}